
		local depvar "pm25"
		local indepvar "treatment "
		local cluslvl "id_mill"

*Panel a: pollution from fires
use "$dataDir/dataset_pollution_harvest_daily_weather", clear

	foreach vd in `depvar' {
		foreach vi in `indepvar'{
	reghdfe `vd' `vi'X2012 `vi'X2013 `vi'X2015 `vi'X2016 `vi'X2017  `vi'X2014 temp_celsius rain rain2, abs(id_mills i.year#i.month) vce(cluster `cluslvl')
		local vtext : variable label `vd'
				if `"`vtext'"' == "" local vtext "`vd'"
coefplot, keep(`vi'X2012 `vi'X2013 `vi'X2014 `vi'X2015 `vi'X2016 `vi'X2017) vertical xlabel(, angle(vertical)) yline(0, lcolor(black)) graphregion(color(white)) omitted order(`vi'X2012 `vi'X2013 `vi'X2014 `vi'X2015 `vi'X2016 `vi'X2017) ciopts(recast(rcap) color(sea)) recast(connected) color(sea) ytitle(Difference regulated and unregulated facilities, size(small)) level(95)
			graph export "$mainDir/figures/Fig4_eventstudy_`vd'_fires.pdf", as(pdf) replace
}
}	

*Panel b: pollution from mills
use "$dataDir/dataset_pollution_mills_year_weather", replace


	foreach vd in `depvar' {
		foreach vi in `indepvar'{
	reghdfe `vd' `vi'X2012 `vi'X2013 `vi'X2015 `vi'X2016 `vi'X2017  `vi'X2014 temp_celsius rain rain2, abs( id_mills year) vce(cluster `cluslvl')
		local vtext : variable label `vd'
				if `"`vtext'"' == "" local vtext "`vd'"
coefplot, keep(`vi'X2012 `vi'X2013 `vi'X2014 `vi'X2015 `vi'X2016 `vi'X2017) vertical yline(0, lcolor(black)) graphregion(color(white)) omitted order(`vi'X2012 `vi'X2013 `vi'X2014 `vi'X2015 `vi'X2016 `vi'X2017) ciopts(recast(rcap) color(sea)) recast(connected) color(sea) ytitle(Difference regulated and unregulated facilities, size(small)) level(95)
			graph export "$mainDir/figures/Fig4_eventstudy_`vd'_mills.pdf", as(pdf) replace
}
}		